//
//  DesignerCell.m
//  BigJoy
//
//  Created by Rowling on 2017/6/15.
//  Copyright © 2017年 Rowling. All rights reserved.
//

#import "DesignerCell.h"
@interface DesignerCell()
@property (weak, nonatomic) IBOutlet UIImageView *headImageView;
@property (weak, nonatomic) IBOutlet UIImageView *topImageView;
@property (weak, nonatomic) IBOutlet UILabel *topLable;
@end

@implementation DesignerCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [XMSuperHelper clipCircleFromeView:self.headImageView withRadius:35];
    self.topImageView.hidden = YES;
    self.topLable.text = @"";
}



-(void)setRank:(NSInteger)rank {
    _rank = rank;
    self.topLable.text = @"";
    self.topImageView.hidden = NO;
    if (rank == 1) {
        self.topImageView.image = [UIImage imageNamed:@"TOP1"];
    }else if (rank == 2) {
        self.topImageView.image = [UIImage imageNamed:@"TOP2"];
    }else if (rank == 3) {
        self.topImageView.image = [UIImage imageNamed:@"TOP3"];
    }else {
        self.topImageView.image = [UIImage imageNamed:@"top"];
        self.topLable.text = [NSString stringWithFormat:@"TOP%ld",rank];
    }
    
    
}



+(instancetype)cellWithTableview:(UITableView *)table {
    DesignerCell * cell = [table dequeueReusableCellWithIdentifier:@"DesignCell"];
    if (cell == nil) {
        cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil].firstObject;
    }
    return cell;
}

@end
